﻿@model IEnumerable<Wolfy.NetDisk.Core.Model.Navigation>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <meta name="description" content="企业,网盘,企业网盘,云盘，企业云盘，云">
    <title> 企业网盘</title>

</head>
<body>

    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">

            <ul class="nav " id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element">

                        <form method="post" enctype="multipart/form-data" id="headerform">
                            <img alt="我的头像" title="我的头像" id="myheader" class="img-circle" src=@ViewBag.user.Header />
                            <input type="file" style="display:none;" name="file" id="iptFile" accept=".jpg,.jpeg,.png,.gif" />
                            <input type="button" style="display:none;" id="btnUpload" />
                            <span class="clear">
                                <span class="block m-t-xs text-name">
                                    <strong class="font-bold">@ViewBag.user.UserName</strong>
                                </span>
                            </span>
                        </form>

                    </div>

                </li>
                <li>
                    @foreach (var item in Model)
                    {
                        if (item.Nav != null)
                        {
                            <ul class="nav nav-second-level">
                                <li class="active">
                                    <a href="@item.Url"><img src="@item.Icon" class="fa" /><span class="nav-label">@item.Name</span></a>
                                </li>
                            </ul>
                        }
                        else
                        {
                            <a href="@item.Url"><img src="@item.Icon" class="fa" /><span class="nav-label">@item.Name</span></a>
                        }

                    }
                </li>
            </ul>


        </nav>
    </div>
    <link href=@Url.ScriptOrCss("~/Content/Css/bootstrap.min.css") rel="stylesheet" />
    <link href=@Url.ScriptOrCss("~/Content/Css/font-awesome/css/font-awesome.min.css") rel="stylesheet" />
    <link href=@Url.ScriptOrCss("~/Content/Css/animate.css") rel="stylesheet" />
    <link href=@Url.ScriptOrCss("~/Content/Css/style.css") rel="stylesheet" />
    <script src=@Url.ScriptOrCss("~/Content/Scripts/jquery-1.10.2.min.js")></script>
    <script src=@Url.ScriptOrCss("~/Content/Scripts/bootstrap.min.js")></script>
    <script src=@Url.ScriptOrCss("~/Scripts/jquery.form.min.js")></script>
    <div id="page-wrapper" class="gray-bg">
        <div class="white-bg wrapper-content">

            @RenderBody()

        </div>
        <div>


        </div>

    </div>


    <script>
        $("#iptFile").change(function () {
            $("#headerform").ajaxSubmit({
                url: "../netdisk/PostedHeader",
                type: "post",
                target: "#myheader",//刷新的区域
                clearForm: true,       // clear all form fields after successful submit
                resetForm: true,       // reset the form after successful submit
                success: function (data) {
                    console.log(data);
                    if (data._code == 200) {
                        $("#myheader").attr("src", data._data.url);
                    };
                },
                error: function (aa) {
                    console.log(aa);
                }
            });
            return false;
        });
        $("#myheader").click(function () {
            $("#iptFile").click();
            return false;
        });
    </script>
</body>
</html>